package cn.rongdao.jrkabao.model.cashadvance;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.bean.cashadvance.CashQuotaFullBean;
import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/11/14
 */

public class CashQuotaFullModel extends BaseKaMaoModel {

    public static CashQuotaFullModel getInstance() {
        return getPresent(CashQuotaFullModel.class);
    }

    public void execute(String id, String institutionId, String isJiFen, String transAmount, Observer<CashQuotaFullBean> observer) {
        addParamStrings("id", id);
        addParamStrings("institution_id", FRString.valueOf(institutionId));
        addParamStrings("is_jifen", FRString.valueOf(isJiFen));
        addParamStrings("trans_amount", FRString.valueOf(transAmount));
        Observable<CashQuotaFullBean> observable = mServletApi.quotaFull(mParams).map(new HttpFunction<CashQuotaFullBean>());
        toSubscribe(observable, observer);
    }
}
